<?php /* Smarty version 2.6.20, created on 2016-07-19 15:19:53
         compiled from ./orders/index.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'shops', './orders/index.php', 11, false),array('block', 'orders', './orders/index.php', 52, false),array('block', 'rights', './orders/index.php', 66, false),array('modifier', 'default', './orders/index.php', 14, false),array('modifier', 'date_format', './orders/index.php', 14, false),array('function', 'html_options', './orders/index.php', 28, false),array('function', 'url', './orders/index.php', 97, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'orders')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "orders/top.php", 'smarty_include_vars' => array('subject' => 'orders')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div id="content">

    <div id="boxquery">
    <form method="get">
         <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="orders.php" />
        <input type="submit" value="查询" class="fr" />
        <li>仓库:&nbsp; <select id="shopid" name="shopid"><option value="">全部</option><?php $this->_tag_stack[] = array('shops', array()); $_block_repeat=true;smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['shops']['id']; ?>
" <?php if ($this->_tpl_vars['shops']['id'] == $_GET['shopid']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['shops']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></select></li>
        <li class="yui-skin-sam">出库时间:&nbsp; 
            <input id="sdate" name="sdate" type="text" size="12" value="<?php echo $_GET['sdate']; ?>
" onfocus="lockinput(this)" />
            <input id="edate" name="edate" type="text" size="12" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['edate'])) ? $this->_run_mod_handler('default', true, $_tmp, time()) : smarty_modifier_default($_tmp, time())))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
" onfocus="lockinput(this)" />
            <div id="calContainer" style="display:none; position:absolute;"></div>
        </li>
        <li><div style="line-height: 15px;float:left;">产品ID:&nbsp; </div><textarea id="product_id" name="product_id" style="resize:horizontal;float:left;height:30px;"><?php echo $_GET['product_id']; ?>
</textarea>
        </li>
        <li>产品关键字:&nbsp; <input id="keywords" name="keywords" type="text" size="30" value="<?php echo $_GET['keywords']; ?>
" /><!--  onclick="select()"
        onkeyup="context_menu_products(this, 'productid=[id],keywords=[title]')" onfocus="context_menu_products(this, 'productid=[id],keywords=[title]')" -->
        <input id="productid" name="productid" type="hidden" value="<?php echo $_GET['productid']; ?>
" />
        </li>
        <li>数量:&nbsp; <input id="lnumber" name="lnumber" type="text" size="4" value="<?php echo $_GET['lnumber']; ?>
"/>-<input id="hnumber" name="hnumber" type="text" size="4" value="<?php echo $_GET['hnumber']; ?>
"/>
        </li>
       	<li>&nbsp;&nbsp;&nbsp;订单号:&nbsp; <input id="lotnumber" name="lotnumber" type="text" size="20"  value="<?php echo $_GET['lotnumber']; ?>
" />
        <li>&nbsp;&nbsp;&nbsp;产品条码:&nbsp; <input id="barcode" name="barcode" type="text" size="15"  value="<?php echo $_GET['barcode']; ?>
" />
        </li>
        <li>类型:&nbsp; <select id="type" name="type"><option value="">全部类型</option><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['type'],'selected' => $_GET['type']), $this);?>
</select></li>
        <li>状态:&nbsp; <select id="status" name="status"><option value="all" >全部</option><option value="0" <?php if (! $_GET['status'] || '0' === $_GET['status']): ?>selected<?php endif; ?>>未处理</option><option value="1" <?php if ('1' === $_GET['status']): ?>selected<?php endif; ?>>已出库</option><option value="-1" <?php if ("-1" === $_GET['status']): ?>selected<?php endif; ?>>未出库</option></select></li>
    </form>
    </div>
	<form action="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&uri=stockconfirm" method="post" onsubmit="return confirm('操作数据后不可恢复, 确定出库?')">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="lister">
      <tbody>
      <tr id="title">
        <?php if ($_GET['status'] === '0' || $_GET['status'] == ''): ?><td width="40"><input type="checkbox" class="checkall" ></td><?php endif; ?>
        <td width="40">序号</td>
        <td width="50">仓库</td>
        <td width="40">产品ID</td>
        <td>产品图</td>
        <td>产品名称</td>
        <td>规格</td>
        <td width="20">单位</td>
        <td align="center" width="50">出库数量</td>
        <td align="center" width="100">库存数(采购在途)</td>
        <td width="160">出库类型</td>
        <td>出库时间</td>
        <td width="80">出库状态</td>
        <td width="50">操作员</td>
        <td></td>
      </tr>
      <?php $this->_tag_stack[] = array('orders', array('limit' => 20,'pager' => 'pager','page' => $this->_tpl_vars['segment']['page'],'order' => 'id desc','shopid' => $_GET['shopid'],'productid' => $_GET['productid'],'product_id' => $_GET['product_id'],'keywords' => $_GET['keywords'],'sdate' => $_GET['sdate'],'edate' => $_GET['edate'],'counter' => 1,'type' => $_GET['type'],'lnumber' => $_GET['lnumber'],'hnumber' => $_GET['hnumber'],'lotnumber' => $_GET['lotnumber'],'status' => $_GET['status'],'barcode' => $_GET['barcode'])); $_block_repeat=true;smarty_block_orders($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
      <tr id="content">
        <?php if ($_GET['status'] === '0' || $_GET['status'] == ''): ?><td><input type="checkbox" value="<?php echo $this->_tpl_vars['orders']['id']; ?>
" class="checkitem" name="chk[]" <?php if ($this->_tpl_vars['orders']['number']-$this->_tpl_vars['orders']['stocks']>0): ?>disabled<?php endif; ?>></td><?php endif; ?>
        <td><?php echo $this->_tpl_vars['orders']['id']; ?>
</td>
        <td><?php echo $this->_tpl_vars['orders']['shop']; ?>
</td>
        <td><?php echo $this->_tpl_vars['orders']['pid']; ?>
</td>
        <td><img src="<?php echo $this->_tpl_vars['orders']['product_pic']; ?>
" width="50" height="50"/></td>
        <td><?php echo $this->_tpl_vars['orders']['product']; ?>
</td>
        <td><?php echo $this->_tpl_vars['orders']['spec']; ?>
</td>
        <td><?php echo $this->_tpl_vars['orders']['unit']; ?>
&nbsp;</td>
        <td align="center"><b><?php echo $this->_tpl_vars['orders']['number']+0; ?>
&nbsp;</b></td>
        <td align="center"<?php if ($this->_tpl_vars['orders']['number']-$this->_tpl_vars['orders']['stocks']-$this->_tpl_vars['orders']['purchases']>0): ?>style="color:red"<?php endif; ?>><?php echo $this->_tpl_vars['orders']['stocks']+0; ?>
(<?php echo $this->_tpl_vars['orders']['purchases']+0; ?>
)</td>
        <td><?php echo $this->_tpl_vars['orders']['type']; ?>
<?php if ($this->_tpl_vars['orders']['lotnumber']): ?>(<?php echo $this->_tpl_vars['orders']['lotnumber']; ?>
)<?php endif; ?></td>
        <td><?php echo ((is_array($_tmp=$this->_tpl_vars['orders']['thedate'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d<br>%H:%M:%S') : smarty_modifier_date_format($_tmp, '%Y-%m-%d<br>%H:%M:%S')); ?>
</td>
        <td><?php if ($this->_tpl_vars['orders']['timestocked'] == 0): ?><?php $this->_tag_stack[] = array('rights', array('right' => 'orders_stock')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><?php if ($this->_tpl_vars['orders']['number']-$this->_tpl_vars['orders']['stocks']>0): ?>库存不足<?php else: ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&orders_id=<?php echo $this->_tpl_vars['orders']['id']; ?>
&uri=stockconfirm"  onclick="return confirm('操作不可恢复, 确定出库?')">确认出库？</a><?php endif; ?><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
        <?php else: ?><?php if ($this->_tpl_vars['orders']['timestocked'] > 0): ?>已出库<?php else: ?>未出库<?php endif; ?><?php endif; ?></td>
        <td>&nbsp;</td>
        <td align="right">
        <?php if ($this->_tpl_vars['orders']['timestocked'] == 0): ?>
        <?php $this->_tag_stack[] = array('rights', array('right' => 'orders_modify')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&orders_id=<?php echo $this->_tpl_vars['orders']['id']; ?>
&uri=modify&page=<?php echo $this->_tpl_vars['segment']['page']; ?>
">编辑</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
        <?php elseif ($this->_tpl_vars['orders']['timestocked'] < 0): ?>
<!--          <?php $this->_tag_stack[] = array('rights', array('right' => 'orders_remove')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&orders_id=<?php echo $this->_tpl_vars['orders']['id']; ?>
&uri=remove" onclick="return confirm('删除数据不可恢复, 确定删除?')">删除</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> -->
        <?php endif; ?>
        <a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&orders_id=<?php echo $this->_tpl_vars['orders']['id']; ?>
&uri=view&page=<?php echo $this->_tpl_vars['segment']['page']; ?>
&status=<?php echo $_GET['status']; ?>
">查看</a>
        </td>
      </tr>
      <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_orders($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
      <?php if ($this->_tpl_vars['pager']->rows == 0): ?>
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      <?php endif; ?>
      </tbody>
      	<?php if ($_GET['status'] === '0' || $_GET['status'] == ''): ?><tfoot>
            <tr>
                <td colspan="15">
	                <input type="hidden" name="act" value="op" />
                    <input type="submit" value="批量出库" />
                </td>
            </tr>
        </tfoot><?php endif; ?>
    </table>
    </form>
    <div id="pager" class="mt10">
        <?php if ($this->_tpl_vars['pager']): ?><span class="fr"><strong>合计</strong>: 出库数量:<?php echo $this->_tpl_vars['orders']['counter']['number']+0; ?>
 </span> 共<?php echo $this->_tpl_vars['pager']->rows; ?>
条记录 第<?php echo $this->_tpl_vars['pager']->pagecurrent; ?>
/<?php echo $this->_tpl_vars['pager']->pages; ?>
页 <?php endif; ?> 		
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => 1), $this);?>
">首页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current-1), $this);?>
">上页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current+1), $this);?>
">下页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->pages), $this);?>
">尾页</a><?php endif; ?>
	</div>
	<p>&nbsp;</p>
    <?php $this->_tag_stack[] = array('rights', array('right' => 'orders_create')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><ul id="addmenu"><li><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=orders.php&uri=create">添加一个新的产品出库</a></li></ul><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
    <form method="post" target="export_iframe" id="export_form" action=""><input type="hidden" value="export" name="act"/></form>
    <iframe src="" style="display:none;" id="export_iframe" name="export_iframe"></iframe>
    <div style="float:right" id="els_export">
            <a href="javascript:;" onclick="$('#export_form').submit();">导出EXCEL</a></div>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>